<?php


namespace app\common\library\design\observer;


class Subject
{
    private $observers = [];

    public function attach($observer){
        array_push($this->observers , $observer);
    }

    public function untach($observer){
        unset($this->observers[$observer]);
    }

    public function notity($data){
        foreach ($this->observers as $observer){
            $observer->update($data);
        }
    }


}